<%--

  @author Kusal Samarakoon
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script src="${pageContext.request.contextPath}/js/printer.js" type="text/javascript"></script>
<%--<link rel="stylesheet" href="${pageContext.request.contextPath}/css/printDetailForm.css" media="print"/>--%>

<script type="text/javascript">

    function fillExtent() {

        totalAreaInPerches = $('#extentVal').val();

        if (!totalAreaInPerches.length) {
            totalAreaInPerches = 0.0;
        }
        totalAreaInPerches = parseFloat(totalAreaInPerches);
        var pe = totalAreaInPerches % 40;
        var ro = ((totalAreaInPerches - pe) / 40) % 4;
        var ac = ((((totalAreaInPerches - pe) / 40) - ro) / 4);
        var he = totalAreaInPerches * 0.002529285264;
        $("#acreId").text(ac);
        $("#roodsId").text(ro);
        $("#perchesId").text(pe.toFixed(4));
        $("#hectareId").text(he.toFixed(4));
    }

    $(function () {
         $('#cancelBtnId').val($('#cancelBtn').val());
        $('#printBtnId').val($('#printBtn').val());
        fillExtent();
    });


</script>

<div id="app-info-module-home-title" class="module-home-title">
    <s:a href="home.do"><img src="${pageContext.request.contextPath}/images/post_letter.png"
                                    alt="Letter Of Confirmation"><span><s:label
            value="%{getText('letterToMinistry.label')}"/></span></s:a>
</div>

<div id="printbtn" class="form-button-div right-align">
    <%--<input type="button" value="Print" id="print"  class="print-btn">--%>
    <%--<input type="button" value="Print" onclick="printPage();">--%>

     <input type="button" id="printBtnId" onclick="printPage('agreementOuter', 'A4', 'P');" />
     <input class="printButton" type="button" id="cancelBtnId" onclick="goBack();" />

</div>
 <div id="agreementOuter">

     <p>

         <pre>



         </pre>

     </p>


     <s:hidden id="extentVal" name="landApplication.getAlienationDetails().getLand().getLandExtent()"/>
    <s:hidden id="printBtn" value="%{getText('print.label')}"/>
    <s:hidden id="cancelBtn" value="%{getText('back.label')}"/>
     </div>